@extends('home.index.layout')
@section('fen')
<!-- 头部 -->
        <div class="header clearfix">
            <div class="wrap">
                <div class="logo" style="background:url(./uploads/{{$data->logo or 'logo.jpg'}})">
                    <a href="{{url('/')}}"></a>
                </div>
 <!--搜索 开始-->
                <div class="search" style="position:relative;">
                    <div class="search-bar clearfix">
                        <form action="/shop/search" id="search-form">
                            <input id="search-input" name="keyword" class="search-input" type="text">
                            <input class="search-btn" value="搜索" type="submit">
                        </form>
                    </div>
                    <ul class="hide" id="shelper" style="display: none;"></ul>
                    <div class="search-keywords" id="keywords">
                            <a href="#" target="_blank">大闸蟹</a>
                            <a href="#" class="hot" target="_blank">蓝莓</a>
                            <a href="#" target="_blank">阿克苏</a>
                            <a href="#" class="hot" target="_blank">易果俱乐部</a>
                            <a href="#" class="hot" target="_blank">奇异果</a>
                        </div>
                </div>
                <!--购物车 开始-->
                <div class="shopping-cart">
    <dl>
        <dt class="shopping-btn"><a href="{{url('/cart/index')}}"> <span class="totleNum"><b>0</b></span><b class="totlePrice">0.0</b></a></dt>
        <dd class="shopping-list">
            <div class="spacer"></div>
            <div class="nogoods" style="">
                购物车中还没有商品，赶紧选购吧！
            </div>
            <div class="goods" style="display: none;">
                <p id="deliveryType" style="display:none;">满100元包邮！</p>
                <ul></ul>
                <div class="price-total">
                    <div><span class="totleNum">共<b>0</b>件商品</span><span>共计<b class="totlePrice">0.0</b></span></div>
                    <div><a href="{{url('/cart/index')}}" class="settleup">去购物车</a></div>
                </div>
            </div>
        </dd>
    </dl>
</div>
                <!--购物车 结束-->
            </div>
        </div>

        



<div class="header-nav">
    <div class="wrap">
        <!--商品分类 开始-->
        <div class="catalogs">
            
            <div class="catalogs-title"><a href="javascript:;">全部商品分类▼</a></div>
            <div class="catalogs-list block" style="display: none;">
                    @foreach(session('publicData') as $f)
                        <div class="item">
                            <h3 class="t01_channelhome"><a href="#"><i></i>{{$f -> tname}}<s>&gt;</s></a></h3>
                            <div class="sub-item" style="display: none;">
                                <h4><a href="#">{{$f -> tname}}</a></h4>
                                
                                @foreach(session('publicShop') as $v)
                                @if($f -> id == $v -> pid)
                                <div class="sub-list"> 
                                            <a href="{{url('shopClass')}}/{{$v -> id}}" target="_blank">{{$v -> tname}}</a>
                                </div>
                                @endif
                                @endforeach


                                        <div class="catalogs-ad">
                                                    <a href="#"><img src="{{url('/ho/imgs/9570160763248445 (1).png')}}" alt="{{$f -> tname}}"></a>
                                        </div>
                            </div>
                        </div>
                    @endforeach
                      
            </div>
        </div>
        <!--商品分类 结束-->
    </div>
</div>


@endsection
@section('content')

<!--轮播广告 -->
<div class="banner-slider">
    <ul class="b-slider" style="position: relative; width: 1903px; height: 500px;">
                <li style="background: rgb(239, 239, 239) none repeat scroll 0% 0%; position: absolute; width: 1903px; left: 0px; top: 0px; display: list-item;" _begintime="2016/11/21 18:44:37" _endtime="2016/11/27 23:59:59" class="current">
                    <a href="http://www.yiguo.com/activity/sale/5622" target="_blank">
                        <div class="slider-wrap">
                            <span class="banner-text">
                                <img src="{{url('/ho/imgs/9570173740622197.png')}}" height="500">
                            </span>
                        </div>

                        <div class="banner-main" style="background:url({{url('ho/imgs/9288698920051067.jpg')}})"></div>
                    </a>
                </li>
                <li style="background: rgb(239, 239, 239) none repeat scroll 0% 0%; position: absolute; width: 1903px; left: 0px; top: 0px; display: none;" _begintime="2016/11/25 18:22:22" _endtime="2016/11/30 23:59:59" _title="送香梨" class="">
                    <a href="http://www.yiguo.com/" target="_blank">
                        <div class="slider-wrap">
                            <span class="banner-text">
                                <img src="{{url('/ho/imgs/9570173865927033.png')}}" height="500">
                            </span>
                        </div>

                        <div class="banner-main" style="background:url({{url('/ho/imgs/9288698889281913.jpg')}})"></div>
                    </a>
                </li>
                <li style="background: rgb(239, 239, 239) none repeat scroll 0% 0%; position: absolute; width: 1903px; left: 0px; top: 0px; display: none;" _begintime="2016/11/18 14:43:45" _endtime="2016/11/30 23:59:59" _title="智利红樱桃500g果径26-28mm" class="">
                    <a href="http://www.yiguo.com/activity/sale/5641" target="_blank">
                        <div class="slider-wrap">
                            <span class="banner-text">
                                <img src="{{url('/ho/imgs/9570173844824441.png')}}" height="500">
                            </span>
                        </div>

                        <div class="banner-main" style="background:url({{url('/ho/imgs/9288698868048249.jpg')}})"></div>
                    </a>
                </li>
                <li style="background: rgb(239, 239, 239) none repeat scroll 0% 0%; position: absolute; width: 1903px; left: 0px; top: 0px; display: none;" _begintime="2016/11/25 10:00:00" _endtime="2016/11/27 23:59:59" _title="易果俱乐部" class="">
                    <a href="http://www.yiguo.com/activity/sale/5648" target="_blank">
                        <div class="slider-wrap">
                            <span class="banner-text">
                                <img src="{{url('/ho/imgs/9570173861962105.png')}}" height="500">
                            </span>
                        </div>

                        <div class="banner-main" style="background:url({{url('/ho/imgs/9288698878304633.jpg')}})"></div>
                    </a>
                </li>
                <li style="background: rgb(239, 239, 239) none repeat scroll 0% 0%; position: absolute; width: 1903px; left: 0px; top: 0px; display: none;" _begintime="2016/11/17 18:42:23" _endtime="2016/11/30 23:59:59" _title="江西赣南脐橙20个约190g/个(北京)" class="">
                    <a href="http://www.yiguo.com/product/1237543.html" target="_blank">
                        <div class="slider-wrap">
                            <span class="banner-text">
                                <img src="{{url('/ho/imgs/9570173634584945.png')}}" height="500">
                            </span>
                        </div>

                        <div class="banner-main" style="background:url({{url('/ho/imgs/9288698657808753.jpg')}})"></div>
                    </a>
                </li>
                <li style="background: rgb(239, 239, 239) none repeat scroll 0% 0%; position: absolute; width: 1903px; left: 0px; top: 0px; display: none;" _begintime="2016/11/21 0:00:00" _endtime="2016/11/30 23:55:50" _title="食品粮油分会场" class="">
                    <a href="http://www.yiguo.com/activity/sale/4164" target="_blank">
                        <div class="slider-wrap">
                            <span class="banner-text">
                                <img src="{{url('/ho/imgs/9570173688455539.png')}}" height="500">
                            </span>
                        </div>

                        <div class="banner-main" style="background:url({{url('/ho/imgs/9288698711679347.jpg')}})"></div>
                    </a>
                </li>
                <li style="background: rgb(239, 239, 239) none repeat scroll 0% 0%; position: absolute; width: 1903px; left: 0px; top: 0px; display: none;" _begintime="2016/11/18 0:00:00" _endtime="2016/11/30 23:55:50" _title="煲汤好时节" class="">
                    <a href="http://www.yiguo.com/activity/sale/4163" target="_blank">
                        <div class="slider-wrap">
                            <span class="banner-text">
                                <img src="{{url('/ho/imgs/9570173676102002.png')}}" height="500">
                            </span>
                        </div>

                        <div class="banner-main" style="background:url({{url('/ho/imgs/9288698699325810.jpg')}})"></div>
                    </a>
                </li>
                <li style="background: rgb(239, 239, 239) none repeat scroll 0% 0%; position: absolute; width: 1903px; left: 0px; top: 0px; display: none;" _begintime="2016/11/17 14:23:53" _endtime="2016/11/30 23:55:50" _title="海鲜周年庆" class="">
                    <a href="http://www.yiguo.com/activity/sale/1202" target="_blank">
                        <div class="slider-wrap">
                            <span class="banner-text">
                                <img src="{{url('/ho/imgs/9570173673415026.png')}}" height="500">
                            </span>
                        </div>

                        <div class="banner-main" style="background:url({{url('/ho/imgs/9288698696573298.jpg')}})"></div>
                    </a>
                </li>
                <li style="background: rgb(239, 239, 239) none repeat scroll 0% 0%; position: absolute; width: 1903px; left: 0px; top: 0px; display: none;" _begintime="2016/11/14 0:00:00" _endtime="2016/11/30 23:59:59" _title="水果冲锋第二份0元起北京专场" class="">
                    <a href="http://www.yiguo.com/activity/sale/5615" target="_blank">
                        <div class="slider-wrap">
                            <span class="banner-text">
                                <img src="{{url('/ho/imgs/9570173763854710.png')}}" height="500">
                            </span>
                        </div>

                        <div class="banner-main" style="background:url({{url('/ho/imgs/9288698698998130.jpg')}})"></div>
                    </a>
                </li>
                <li style="background: rgb(239, 239, 239) none repeat scroll 0% 0%; position: absolute; width: 1903px; left: 0px; top: 0px; display: none;" _begintime="2016/11/16 11:24:32" _endtime="2017/10/31 9:36:02" class="">
                    <a href="http://www.yiguo.com/activity/sale/5620" target="_blank">
                        <div class="slider-wrap">
                            <span class="banner-text">
                                <img src="{{url('/ho/imgs/9570173567738224.png')}}" height="500">
                            </span>
                        </div>

                        <div class="banner-main" style="background:url({{url('/ho/imgs/9288697308717366.jpg')}})"></div>
                    </a>
                </li>
                <li style="background: rgb(239, 239, 239) none repeat scroll 0% 0%; position: absolute; width: 1903px; left: 0px; top: 0px; display: none;" _begintime="2016/11/15 14:08:56" _endtime="2017/1/20 23:55:00" class="">
                    <a href="http://www.yiguo.com/activity/sale/bank031" target="_blank">
                        <div class="slider-wrap">
                            <span class="banner-text">
                                <img src="{{url('/ho/imgs/9570173536543087.png')}}" height="500">
                            </span>
                        </div>

                        <div class="banner-main" style="background:url({{url('/ho/imgs/9288698559766895.jpg')}})"></div>
                    </a>
                </li>
    </ul>
    <div class="b-btn">
        <a class="prev" href="javascript:void(0)" style="opacity: 0.3; display: none;"></a>
        <a class="next" href="javascript:void(0)" style="opacity: 0.3; display: none;"></a>
    </div>
    <div class="b-dot">
        <ul><li class="on">1</li><li class="">2</li><li class="">3</li><li class="">4</li><li class="">5</li><li class="">6</li><li class="">7</li><li class="">8</li><li class="">9</li><li class="">10</li><li class="">11</li></ul>
    </div>
</div>

<!-- 商品楼层 -->
<!-- {{$i = 1}} -->
    @foreach($data as $u)
        <div class="floor wrap 01_channelhome clearfix loadfloor loaded" id="t0{{$i}}_channelhome" data-url="/Home/Floor?floorId=01_channelhome">
    @if($u -> pid == 0 )

        <div class="floor-title ">
            <h2><a href="/shopClass/{{$u -> id}}" target="_blank"><i>F{{$i}}</i>{{$u -> tname}}</a></h2>
                
        </div>
    @endif
        <!-- {{$j = 0}} -->
    <div class="wrap ad-item">
        <ul>
        @foreach($shop as $v)
        @if($u -> id == $v -> pid)
        @if($j < 3)
                <li>

                    <a href="/shopClass/{{$v -> id}}" target="_blank">
                        <img src="{{url('/uploads/category')}}/{{$v -> picture}}" width="290">
                            <p><b>{{$v -> tname}}</b>探访源头产地 臻选当令时鲜</p>
                    </a>
                </li>
        @endif
              <!-- {{$j = $j + 1}} -->
        @endif

        @endforeach
        </ul>
    </div>

</div>
<!-- {{$i = $i + 1}} -->
    @endforeach    


        <!--腰线 开始-->
        <!-- 楼层引导 -->
        
<div class="floor-guide" style="display: none;">
    <div class="mui-nav">
        <!-- {{$i = 1}} -->
        @foreach($data as $u)
            <a href="#t0{{$i}}_channelhome" class="current">
                <b class="icon_0{{$i}}_channelhome">&nbsp;</b>
                <em>{{ $u -> tname}}</em>
                <i>&nbsp;</i>
            </a>
        <!-- {{$i = $i + 1}} -->
        @endforeach
            
    </div>
</div>

<div class="suggest" id="search-suggest" style="display:none;width:445px;height:50px;background:white;">
    <ul id="search-result">
       
    </ul>
</div>

<script>
    // alert($)
    $('#search-input').bind('keyup',function()
    {
        var value = $('#search-input').val();
        // alert(value);
        $.ajax({
            url:"{{asset('/shopClass')}}",
            type:"GET",
            data:{value:value},
            success:function(data)
            {
                var html = '';
                for(var i=0;i<data.length;i++)
                {

                    html += '<li class="search-li">'+data[i]['gname']+'/'+data[i]['gid']+'</li>';
                }
                $('#search-result').html(html);
            
            },
            error:function()
            {
                alert(0);
            }
        });
        var t = $('#search-form').offset().top+$('#search-form').height();
        // alert(t);
        $('#search-suggest').show().css({
            top:$('#search-form').offset().top+$('#search-form').height()+28,
            left:$('#search-form').offset().left,
            position:'absolute'
        });

    });
    $(document).bind('click',function()
    {
        $('#search-suggest').hide();
    });

    $(document).delegate('.search-li','click',function()
    {
        var gid = $(this).text();
        arr = gid.split('/');
        var num = arr['1'];
        var url = '/detail/'+num;
        location.href = url;
    })
</script>
@endsection